<?php
class Scenery_region_model extends CI_Model
{
    private $table = 'scenery_region';

    public function find($params = array())
    {
        $this->db->where('type', 1);
        if (!empty($params['region_id'])) {
            $this->db->where('region_id', $params['region_id']);
        }
        $this->db->where_not_in('region_id', array(5,20,28,29,33,34,35));//5:甘肃，20：宁夏，28：西藏, 29：新疆，33：香港，34：澳门，35：台湾
        $this->db->order_by('region_id', 'ASC');
        return $this->db->get($this->table);
    }

    public function findByRegionId($region_id)
    {
        $this->db->where('type', 1);
        $this->db->where('region_id', $region_id);
        $this->db->limit(1);
        return $this->db->get($this->table);
    }
}